Skip to content

Remove more deprecated android code and unify openal settings#2776

Merged
riccardobl merged 5 commits into
jMonkeyEngine:masterfrom
riccardobl:androidfix
May 17, 2026
Merged

Remove more deprecated android code and unify openal settings#2776
riccardobl merged 5 commits into
jMonkeyEngine:masterfrom
riccardobl:androidfix

Conversation

@riccardobl
Copy link
Copy Markdown
Member

This PR removes the old untested android surface based path and unifies the LWJGL and android OpenAL AppSetting to simply AppSetting.OPENAL, then removes the createSettings in android fragment, that is now useless.

The goal is to let the developer use the same SimpleApplication creation pattern used in the desktop backend

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request unifies the OpenAL audio renderer settings across platforms by introducing a new OPENAL constant in AppSettings and deprecating platform-specific constants like LWJGL_OPENAL and ANDROID_OPENAL_SOFT. It also removes the com.jme3.view.surfaceview package and simplifies the Android harness by removing the configureSettings and createSettings hooks. Review feedback identifies a functional regression in JmeFragment where example settings are no longer applied, logic inconsistencies and outdated log messages in JmeAndroidSystem, and a potential NullPointerException in JmeDesktopSystem.

Comment thread jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java Outdated
Comment thread jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java Outdated
@github-actions
Copy link
Copy Markdown

🖼️ Screenshot tests have failed.

The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests.

📄 Where to find the report:

⚠️ If you didn't expect to change anything visual:
Fix your changes so the screenshot tests pass.

If you did mean to change things:
Review the replacement images in jme3-screenshot-tests/build/changed-images to make sure they really are improvements and then replace and commit the replacement images at jme3-screenshot-tests/src/test/resources.

If you are creating entirely new tests:
Find the new images in jme3-screenshot-tests/build/changed-images and commit the new images at jme3-screenshot-tests/src/test/resources.

Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar".

See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information

Contact @richardTingle (aka richtea) for guidance if required

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes deprecated/unmaintained Android SurfaceView integration and unifies audio renderer selection across desktop and Android by introducing AppSettings.OPENAL (and switching the default audio renderer to it), aiming to align Android app startup patterns with the desktop backend.

Changes:

  • Added AppSettings.OPENAL, deprecated platform-specific OpenAL constants, and switched the default AudioRenderer setting to OPENAL.
  • Updated desktop audio renderer selection to accept the new OPENAL setting.
  • Removed the deprecated Android com.jme3.view.surfaceview implementation and simplified AndroidHarnessFragment startup/configuration hooks; cleaned up Android examples accordingly.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java Treat AppSettings.OPENAL as a valid audio renderer choice for desktop OpenAL initialization.
jme3-core/src/main/java/com/jme3/system/AppSettings.java Introduce OPENAL, deprecate old constants, and change the default audio renderer to OPENAL.
jme3-android/src/main/java/com/jme3/view/surfaceview/package-info.java Remove deprecated SurfaceView package documentation (package removed).
jme3-android/src/main/java/com/jme3/view/surfaceview/OnRendererStarted.java Remove deprecated SurfaceView lifecycle interface.
jme3-android/src/main/java/com/jme3/view/surfaceview/OnRendererCompleted.java Remove deprecated SurfaceView lifecycle interface.
jme3-android/src/main/java/com/jme3/view/surfaceview/OnLayoutDrawn.java Remove deprecated SurfaceView lifecycle interface.
jme3-android/src/main/java/com/jme3/view/surfaceview/OnExceptionThrown.java Remove deprecated SurfaceView lifecycle interface.
jme3-android/src/main/java/com/jme3/view/surfaceview/JmeSurfaceView.java Remove deprecated/untested SurfaceView-based rendering path.
jme3-android/src/main/java/com/jme3/view/package-info.java Remove deprecated com.jme3.view package documentation.
jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java Remove unused audio-renderer “type” tracking API.
jme3-android/src/main/java/com/jme3/app/AndroidHarnessFragment.java Remove settings hook methods and rely on the application/default settings pattern.
jme3-android-examples/src/main/res/values/strings.xml Remove strings tied to deleted menu toggles.
jme3-android-examples/src/main/res/menu/menu_items.xml Remove menu items tied to deleted input toggles.
jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/TestActivity.java Stop passing removed input-toggle extras; keep verbose logging flag with explicit default.
jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java Remove input-toggle state and menu handling; add DEFAULT_VERBOSE_LOGGING.
jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/JmeFragment.java Move settings setup into createApplication() consistent with the new fragment pattern.
jme3-android-examples/build.gradle Update runAndroidExamples task to only pass verbose logging flag (configurable via property).
Comments suppressed due to low confidence (2)

jme3-core/src/main/java/com/jme3/system/AppSettings.java:273

  • The new @deprecated tags for the JOGL renderer constants say "Use LWJGL" but don’t reference a specific replacement constant (and include trailing whitespace). Please update the deprecation text to point to the intended replacement(s) via {@link ...} (e.g., a specific LWJGL_OPENGL* constant) and clean up the formatting so generated Javadoc is unambiguous.
    /**
     * Use JogAmp's JOGL as the display system, with the OpenGL forward compatible profile
     * <p>
     * N.B: This backend is EXPERIMENTAL
     *
     * @see AppSettings#setRenderer(java.lang.String)
     * @deprecated Use LWJGL 
     */
    @Deprecated
    public static final String JOGL_OPENGL_FORWARD_COMPATIBLE = "JOGL_OPENGL_FORWARD_COMPATIBLE";

    /**
     * Use JogAmp's JOGL as the display system, with the backward compatible profile
     * <p>
     * N.B: This backend is EXPERIMENTAL
     *
     * @see AppSettings#setRenderer(java.lang.String)
     * @deprecated Use LWJGL 
     */
    @Deprecated
    public static final String JOGL_OPENGL_BACKWARD_COMPATIBLE = "JOGL_OPENGL_BACKWARD_COMPATIBLE";

jme3-android/src/main/java/com/jme3/app/AndroidHarnessFragment.java:104

  • createSettings()/configureSettings() hooks were removed, and onCreate() now starts the app immediately after createApplication(). This is a breaking change for existing subclasses overriding those methods, and the class Javadoc still implies subclasses can "optionally customize settings" without explaining the new pattern. Consider keeping the hooks as deprecated pass-throughs for a transition period or update the Javadoc to clearly state that subclasses must call app.setSettings(...) inside createApplication() (or accept the defaults).
        System.setProperty(
                BufferAllocatorFactory.PROPERTY_BUFFER_ALLOCATOR_IMPLEMENTATION,
                AndroidNativeBufferAllocator.class.getName());

        try {
            app = createApplication();
            app.start();
            OGLESContext context = (OGLESContext) app.getContext();
            context.setSystemListener(this);
        } catch (Exception exception) {
            handleError("jME application initialization failed", exception);
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java
* @see AppSettings#setAudioRenderer(java.lang.String)
* @deprecated This audio renderer has too many limitations.
* use {@link #ANDROID_OPENAL_SOFT} instead.
* @deprecated This audio renderer has too many limitations. Use {@link #OPENAL} instead..
Comment thread jme3-core/src/main/java/com/jme3/system/AppSettings.java
@riccardobl riccardobl merged commit d93e758 into jMonkeyEngine:master May 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants